package com.example.demo.controller;

import com.example.demo.ServerResponse;
import com.example.demo.entity.Log;
import com.example.demo.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AdminController {
    @Autowired
    LogService logService;

    @GetMapping("/getLog")
    public ServerResponse<List<Log>> getlog(){
        List<Log> list = logService.getLogs();
        return ServerResponse.createBySuccess(200,list,"获取成功");
    }
}